#include "boundingSphere.h"

BoundingSphere::BoundingSphere(d_Vec3f center, float radius, Object3D *object, Material *mat)
{
	this->object = object;
	sphere = new Sphere(center, radius, NULL);
	material = mat;
}

bool BoundingSphere::intersect(const Ray &r, Hit &h, float tmin)
{
	Hit hit(10000, NULL, d_Vec3f(0,1,0));
	if(sphere->intersect(r, hit, tmin))
		return object->intersect(r, h, tmin);
	return false;
}
